package config

import (
	_ "github.com/zeromicro/go-zero/core/discov"
	"github.com/zeromicro/go-zero/core/logx"
	"github.com/zeromicro/go-zero/rest"
	"github.com/zeromicro/go-zero/zrpc"
)

type Config struct {
	RestServices      map[string]ServiceConfig
	ServicesLogConfig map[string]ServicesLogConfig
	Parallelism       int
	AgentConf         AgentConfig
	Mysql             MysqlConfig
	SQLite            SQLiteConfig
	EnableRsync       bool
	Auth              struct {
		AccessSecret string
		AccessExpire int
	}
	RpcService RpcServiceConfig
	UseMysql   bool
}

type MysqlConfig struct {
	DataSource string
	Tables     struct {
		UserInfoTable          string
		AgentHeartbeats        string
		ComponentInfo          string
		DeploymentLogs         string
		DocumentationKnowledge string
		ClusterInfo            string
		AuditLogs              string
	}
}

type SQLiteConfig struct {
	DataSource string
	Tables     struct {
		UserInfoTable          string
		AgentHeartbeats        string
		ComponentInfo          string
		DeploymentLogs         string
		DocumentationKnowledge string
		ClusterInfo            string
		AuditLogs              string
	}
}

type AgentConfig struct {
	MemoryMax   string
	MetricsPort int32
}

type ServiceConfig struct {
	RestConf rest.RestConf
}

type RpcServiceConfig struct {
	zrpc.RpcServerConf
}

type ServicesLogConfig struct {
	logx.LogConf
}
